////创建者:Icarus
////手动滑稽,滑稽脸
////ヾ(•ω•`)o
////https://www.ykls.app
////2019年11月02日-21:03
////Assembly-CSharp-Editor

//using UnityEditor;
//using UnityEngine;

//namespace CabinIcarus.ProjectBrowserAliasTools
//{
//    //https://github.com/Unity-Technologies/UnityCsReference/blob/master/Editor/Mono/ProjectBrowser.cs

//    public partial class ProjectEntityAssetDes
//    {
//        //[InitializeOnLoad]
//        //[InitializeOnLoadMethod]
//        static void Init()
//        {
//           // AliasSettingWindow.Init();
//            EditorApplication.projectWindowItemOnGUI += _projectWindowItemOnGui;
//        }


//        private static void _projectWindowItemOnGui(string guid, Rect selectionrect)
//        {
//            var alias = AliasSettingWindow.GetAliasGuid(guid);

//            if (alias == null || alias.Length == 0)
//            {
//                return;
//            }

//            var aliasContent = new GUIContent(alias);

//            Vector2 size = EditorStyles.label.CalcSize(aliasContent);

//            var isTree = IsTreeView(selectionrect);

//            if (!isTree)
//            {
//                IsIconSmall(ref selectionrect);
//            }

//            Rect textRect = new Rect(
//                selectionrect.x + 2f + Mathf.Max(0, (selectionrect.width - size.x) * 0.5f),
//                selectionrect.yMax - 15,
//                size.x, 20f);

//            float cropWidth = selectionrect.width;

//            if (isTree)
//            {
//                textRect.width = 50;
//                cropWidth = textRect.width;
//                textRect.x = selectionrect.xMax - textRect.width;
//                selectionrect.y = selectionrect.y;
//            }

//            aliasContent.text = EditorStyles.label.CropText(aliasContent.text, cropWidth);

//            EditorGUI.LabelField(textRect, aliasContent);

//            EditorApplication.RepaintProjectWindow();
//        }


//        private static bool IsTreeView(Rect rect)
//        {
//            return rect.height <= 21f;
//        }

//        // https://github.com/PhannGor/unity3d-rainbow-folders/blob/master/Assets/Plugins/RainbowFolders/Editor/Scripts/RainbowFoldersBrowserIcons.cs
//        private static bool IsIconSmall(ref Rect rect)
//        {
//            var isSmall = rect.width > rect.height;

//            if (isSmall)
//                rect.width = rect.height;
//            else
//                rect.height = rect.width;

//            return isSmall;
//        }
//    }
//}